import { pubRequire } from '@utils/public'
const baseUrl = '/coupons'
// 营课优惠券配置列表
export function getCampClass(params, callBack, errBack) {
    return pubRequire('get', `${baseUrl}/configurations/lives`, params, callBack, errBack)
}

//上架营课优惠券配置
export function CampClassUpShelf(couponId,params,callBack, errBack) {
  return pubRequire('put', `${baseUrl}/configurations/lives/${couponId}/on`,params, callBack, errBack)
}

//下架营课优惠券配置
export function CampClassDownShelf(couponId,params,callBack, errBack) {
  return pubRequire('put', `${baseUrl}/configurations/lives/${couponId}/off`,params,callBack, errBack)
}

//删除营课优惠券配置
export function CampClassDelete(couponId,callBack, errBack) {
  return pubRequire('delete', `${baseUrl}/configurations/lives/${couponId}`,{},callBack, errBack)
}


// 查询直播优惠券列表
export function getCampClassLives(callBack, errBack) {
  return pubRequire('get', `${baseUrl}/configurations/lives?type=common`, {}, callBack, errBack)
}

// 添加优惠券配置
export function addCampClass(params, callBack, errBack) {
  return pubRequire('post', `${baseUrl}/configurations/lives`, params, callBack, errBack)
}

// 营课优惠券配置详情
export function getCampClassDetail(couponId, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/configurations/lives/${couponId}`, {}, callBack, errBack)
}

// 编辑营课优惠券配置
export function eidtCampClass(couponId, params, callBack, errBack) {
  return pubRequire('patch', `${baseUrl}/configurations/lives/${couponId}`, params, callBack, errBack)
}